#include "list.h"

int List::getSize()
{
	return size;
}

void List::add(const Vertex &v1, const Vertex &v2, int index1, int index2)
{
	if (!head)
	{
		head = new ListNode(v1, v2, index1, index2);
		tail = head;
		current = head;
	}
	else
	{
		tail->next = new ListNode(v1, v2, index1, index2);
		tail = tail->next;
	}

	size++;
}

// Performs a natural iteration, I hate having to do iteration manually from
// the outside :(
Edge *List::getNext()
{
	if (!current)
	{
		current = head;
		return 0;
	}

	Edge *e = &current->edge;
	current = current->next;
	return e;
}
